package TJISE.day03;

public class DynamicPolymorphism {
    public static void main(String[] args) {
       SubClass s1 = new SubClass();
       s1.m1();
       s1.m2();
  }
}

class SuperClass{
    void m1(){
        System.out.println("父类方法1");
    }
    void m2(){
        System.out.println("父类方法2");
    }

}
   class SubClass extends SuperClass{ //子类SubClass 继承了 父类 SuperClass
       @Override     //重写
      void m1() {
           super.m1();
           System.out.println("子类重写之后的m1");
       }
       @Override
       void m2() {
           super.m2();
           System.out.println("子类重写之后的m2");
       }
   }

   //Ctrl +  o  : 重写
